package cn.ac.iscas.domain.job;

import java.util.Date;

/**
 * Created by ISCAS on 2017/11/2.
 *
 * 待进一步完善
 */
public class JobLog {
	/**
	 * 日志级别
	 */
	public enum Level{debug, info, warn, error}

	/**
	 * 消息时间戳
	 */
	private Date timestamp = new Date();

	/**
	 * 日志级别
	 */
	private Level level;

	/**
	 * 消息体
	 */
	private String msg;

	/**
	 * 任务当前状态
	 */
	private JobStatus status;


	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public JobStatus getStatus() {
		return status;
	}

	public void setStatus(JobStatus status) {
		this.status = status;
	}

	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}

	@Override
	public String toString() {
		return String.format("[%s] Job status: %s %s", level.name(), status, msg);
	}
}
